TileStore

open class TileStore

TileStore manages downloads and storage for requests to tile-related API endpoints, enforcing a disk usage quota: tiles available on disk may be deleted to make room for a new download. This interface can be used by an app developer to set the disk quota. The rest of TileStore API is intended for native SDK consumption only.

Functions

addObserver
Link copied to clipboard
open fun addObserver(@NonNull() observer: TileStoreObserver)
Adds a new observer to the TileStore instance.Note that observers will be notified of changes until they're explicitly removed again.
computeCoveredArea
Link copied to clipboard
open fun computeCoveredArea(@NonNull() descriptors: List<TilesetDescriptor>, @NonNull() callback: TileRegionGeometryCallback)
Computes a polygon of the area covered by the tiles cached in TileStore with the specified TilesetDescriptors.
create
Link copied to clipboard
open fun create(): TileStore
Creates a TileStore instance at the default location.If the tile store instance already exists for the default location this method will return it without creatinga new instance, thus making sure that there is only one tile store instance for a path at a time.
open fun create(@NonNull() path: String): TileStore
Creates a TileStore instance for the given storage path.The returned instance exists as long as it is retained by the client.If the tile store instance already exists for the given path this method will return it without creatinga new instance, thus making sure that there is only one tile store instance for a path at a time.If the given path is empty, the tile store at the default location is returned.On iOS, this storage path is excluded from automatic cloud backup.On Android, please exclude the storage path in your Manifest.Please refer to the [Android Documentation](https://developer.android.com/guide/topics/data/autobackup.html#IncludingFiles) for detailed information.
getAllTileRegions
Link copied to clipboard
open fun getAllTileRegions(@NonNull() callback: TileRegionsCallback)
Returns a list of the existing tile regions.Note: The user-provided callbacks will be executed on a TileStore-controlled worker thread;it is the responsibility of the user to dispatch to a user-controlled thread.
getTileRegion
Link copied to clipboard
open fun getTileRegion(@NonNull() id: String, @NonNull() callback: TileRegionCallback)
Returns a tile region by its id.Note: The user-provided callbacks will be executed on a TileStore-controlled worker thread;it is the responsibility of the user to dispatch to a user-controlled thread.
getTileRegionGeometry
Link copied to clipboard
open fun getTileRegionGeometry(@NonNull() id: String, @NonNull() callback: TileRegionGeometryCallback)
Returns a tile region's associated geometryThe region associated geometry is provided by the client and it represents the area, which the tileregion must cover.
getTileRegionMetadata
Link copied to clipboard
open fun getTileRegionMetadata(@NonNull() id: String, @NonNull() callback: TileRegionMetadataCallback)
Returns a tile region's associated metadataThe region's associated metadata that a user previously set for this region.
loadTileRegion
Link copied to clipboard
open fun loadTileRegion(@NonNull() id: String, @NonNull() loadOptions: TileRegionLoadOptions): Cancelable
An overloaded version that does not report progess or finished status of the loading operation.
open fun loadTileRegion(@NonNull() id: String, @NonNull() loadOptions: TileRegionLoadOptions, @NonNull() onFinished: TileRegionCallback): Cancelable
An overloaded version that does not report progess of the loading operation.
open fun loadTileRegion(@NonNull() id: String, @NonNull() loadOptions: TileRegionLoadOptions, @NonNull() onProgress: TileRegionLoadProgressCallback, @NonNull() onFinished: TileRegionCallback): Cancelable
Loads a new tile region or updates the existing one.Creating of a new region requires providing both geometry and tilesetdescriptors to the given load options, otherwise the load request failswith RegionNotFound error.If a tile region with the given id already exists, it gets updated withthe values provided to the given load options.
removeObserver
Link copied to clipboard
open fun removeObserver(@NonNull() observer: TileStoreObserver)
Removes an existing observer from the TileStore instance.If the observer isn't attached to the TileStore anymore, this is a no-op.
removeTileRegion
Link copied to clipboard
open fun removeTileRegion(@NonNull() id: String)
Removes a tile region.Removes a tile region from the existing packages list.
open fun removeTileRegion(@NonNull() id: String, @NonNull() callback: TileRegionCallback)
An overloaded version with a callback for feedback.On successful tile region removal, the given callback is invoked with the removed tile region.
setOption
Link copied to clipboard
open fun setOption(@NonNull() key: String, @NonNull() value: Value)
Sets additional options for this instance.
open fun setOption(@NonNull() key: String, @NonNull() domain: TileDataDomain, @NonNull() value: Value)
Sets additional options for this instance that are specific to a data type.
tileRegionContainsDescriptors
Link copied to clipboard
open fun tileRegionContainsDescriptors(@NonNull() id: String, @NonNull() descriptors: List<TilesetDescriptor>, @NonNull() callback: TileRegionBooleanCallback)
Checks if a tile region with the given id contains all tilesets from all of the given tileset descriptors.Note: The user-provided callbacks will be executed on a TileStore-controlled worker thread;it is the responsibility of the user to dispatch to a user-controlled thread.